<template>
	<view class="cart">
		<view class="cart-content" v-if="cartList.length">
			<view class="content-title">
				<view class="left-title">共一件商品</view>
				<view class="right-title">编辑</view>
			</view>
			<view class="content-list">
				<checkbox-group @change="checkboxChange">
					<view class="content-item" v-for="(item,i) in cartList" :key="i">

						<checkbox :checked="item.checked" style="transform:scale(0.6)" color="#fff" />
						<view class="item-msg">
							<image class="img_i" :src="item.img_i" mode="aspectFill"></image>
							<view class="right-text">
								<view class="title-text">{{item.title}}</view>
								<view class="size-text">{{item.size}}</view>
								<view class="num-text">
									<view class="prive-text">￥{{item.price}}</view>
									<uni-number-box :min="1" :value="item.num" @change="changeValue" />
								</view>
							</view>
						</view>
					</view>
				</checkbox-group>
			</view>
			<view class="account">
				<view class="left-acc">
					<view class="checkbox">
						<checkbox style="transform:scale(0.6)" color="#fff" value="cb" checked="true" />
						<view class="text-check">
							全选 (0)
						</view>
					</view>
					<view class="price-num">
						<text class="num-icon">￥</text>200
					</view>
				</view>
				<view class="right-btn-acc">去结算</view>
			</view>
		</view>
		<view class="cart-content-null" v-else>
			<view class="null">
				<image class="cart-img" src="../../static/img/cart-null.png" mode=""></image>
				<view class="text_">购物车空空如也~</view>
				<view class="btn_one">再逛逛</view>
			</view>
			<view class="guess-you">
				<view class="title">猜你喜欢</view>
				<t-big-cart :bigCartList="bigCartList"></t-big-cart>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				bigCartList: [{
						name: '牛仔裙',
						price: 699.00,
						goods_ok: 9,
						goods_img: '../../static/img/big_1.png'
					},
					{
						name: '连衣裙',
						price: 699.00,
						goods_ok: 9,
						goods_img: '../../static/img/big_2.png'
					},
					{
						name: '新款毛衣',
						price: 699.00,
						goods_ok: 9,
						goods_img: '../../static/img/big_4.png'
					},
					{
						name: '新款毛衣',
						price: 699.00,
						goods_ok: 9,
						goods_img: '../../static/img/big_4.png'
					},
				],
				cartList: [{
					img_i: '../../static/img/big_2.png',
					title: '毛衣',
					size: '小香风毛衣M码',
					price: '99.90',
					num: 1
				}, {
					img_i: '../../static/img/big_2.png',
					title: '毛衣',
					size: '小香风毛衣M码',
					price: '99.90',
					num: 2
				}, {
					img_i: '../../static/img/big_2.png',
					title: '毛衣',
					size: '小香风毛衣M码',
					price: '99.90',
					num: 2
				}],
				isChecked: false
			};
		},
		methods: {
			changeValue(e) {
				console.log(e);
			},
			checkboxChange(e) {
				console.log(e);
			}
		}
	}
</script>

<style lang="scss">
	page {
		// background-color: #ccc;
	}

	/deep/ .uni-checkbox-input {
		border-radius: 50%;
	}

	/deep/ .uni-checkbox-input-checked {
		background-color: #d81e06;
	}

	/deep/ .uni-countdown__splitor {
		color: #fff !important;
	}

	/deep/ .uni-numbox-btns {
		width: 42rpx;
		height: 42rpx;
		border: 1rpx solid #a0a0a0;
		padding: 0;
		background-color: #eee !important;
	}

	/deep/ .uni-numbox__minus {
		border-radius: 5rpx 0rpx 0rpx 5rpx;
	}

	/deep/ .uni-numbox__plus {
		border-top-right-radius: 5rpx;
		border-bottom-right-radius: 5rpx;
	}

	/deep/ .uni-numbox--text {
		font-size: 30rpx;
		color: #545454;
	}

	/deep/ .uni-numbox__value {
		font-size: 24rpx;
		margin: 0;
		width: 78rpx;
		height: 42rpx;
		border-top: 1rpx solid #a0a0a0;
		border-bottom: 1rpx solid #a0a0a0;
		background-color: #fff !important;
	}

	.cart {
		.cart-content {
			.content-title {
				padding: 0 18rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				height: 60rpx;
				width: 100%;
				box-sizing: border-box;

				.left-title {
					font-size: 24rpx;
					letter-spacing: 2rpx;
					color: #333333;
				}

				.right-title {
					font-size: 24rpx;
					letter-spacing: 2rpx;
					color: #989898;
				}
			}

			.content-list {
				.content-item {
					display: flex;
					align-items: center;
					background-color: #fff;
					padding: 37rpx 10rpx;
					margin-bottom: 15rpx;

					.item-msg {
						display: flex;

						.img_i {
							width: 146rpx;
							height: 146rpx;
							margin-right: 20rpx;
						}

						.right-text {
							width: 490rpx;

							.title-text {
								font-size: 28rpx;
								letter-spacing: 3rpx;
								color: #545454;
							}

							.size-text {
								font-size: 22rpx;
								letter-spacing: 2rpx;
								color: #989898;
								margin: 15rpx 0 25rpx 0;
							}

							.num-text {
								display: flex;
								align-items: center;
								justify-content: space-between;

								.prive-text {
									font-size: 28rpx;
									letter-spacing: 3rpx;
									color: #d81e06;
								}
							}
						}
					}
				}
			}

			.account {
				position: absolute;
				bottom: 0;
				left: 0;
				width: 100%;
				height: 81rpx;
				background-color: #ffffff;
				border-radius: 5rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.left-acc {
					display: flex;
					align-items: center;
					justify-content: space-between;
					// text-align: center;
					width: 494rpx;
					padding-right: 40rpx;

					.checkbox {
						display: flex;
						align-items: center;

						.text-check {}
					}

					.price-num {
						font-size: 40rpx;
						font-weight: bold;
						color: #d81e06;

						.num-icon {
							margin-right: 10rpx;
							font-weight: normal;
							font-size: 30rpx;
							color: #d81e06;
						}
					}
				}

				.right-btn-acc {
					display: flex;
					align-items: center;
					justify-content: center;
					color: #fff;
					width: 256rpx;
					height: 82rpx;
					background-color: #c60122;
				}

			}
		}

		.cart-content-null {
			.null {
				display: flex;
				align-items: center;
				flex-direction: column;
				width: 100%;
				height: 500rpx;
				background-color: #eeeeee;

				.cart-img {
					margin-top: 143rpx;
					width: 229rpx;
					height: 195rpx;
				}

				.text_ {
					margin-top: 14rpx;
					font-size: 20rpx;
					letter-spacing: 2rpx;
					color: #989898;
				}

				.btn_one {
					margin-top: 33rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					width: 119rpx;
					height: 46rpx;
					background-color: #c60122;
					border-radius: 23rpx;
					font-size: 22rpx;
					letter-spacing: 2rpx;
					color: #ffffff;
				}
			}

			.guess-you {
				margin: 40rpx 18rpx 0;

				.title {
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 28rpx;
					letter-spacing: 3rpx;
					color: #363636;
					margin-bottom: 30rpx;
				}
			}
		}

	}
</style>
